package com.sunda.spmsweb.overseacontroller;


import com.sunda.spmscommon.ResponseResult;
import com.sunda.spmsoversea.service.IOverseaOperateLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 海外仓操作日志表 前端控制器
 * </p>
 *
 * @author Wayne
 * @since 2021-08-26
 */
@RestController
@RequestMapping("/overseaOperateLog")
@Api(tags = "海外仓单据日志", description = "海外仓单据日志")
public class OverseaOperateLogController {

    @Autowired
    IOverseaOperateLogService iOverseaOperateLogService;

    @RequestMapping("/getByDocumentNumber")
    @ApiOperation(value = "根据关联单据号查询操作记录", notes = "根据关联单据号查询操作记录\n" +
            "示例：documentNumber = 0700442654 或 477913a4d18f45c8b8471d5f2b656053\n",
            httpMethod = "POST")
    public ResponseResult getByDocumentNumber(String documentNumber){
        try {
            return ResponseResult.success().add("overseaOperateLogList", iOverseaOperateLogService.getByDocumentNumber(documentNumber));
        }catch (Exception e){
            e.printStackTrace();
            return ResponseResult.error("请求数据失败").add("error", e.getMessage());
        }
    }
}
